﻿IF EXISTS (SELECT * from sys.procedures p left join sys.schemas s on p.schema_id = s.schema_id where p.name='geolocalisation_insert' and s.name='Meta')
DROP PROCEDURE [Meta].geolocalisation_insert
GO
CREATE PROCEDURE [Meta].geolocalisation_insert 
@PK uniqueidentifier, 
@Latitude float,
@Longitude float,
@DisplayName nvarchar(50),
@ItemType varchar(30)
AS
BEGIN
INSERT INTO [Meta].[Geolocalisation]
([id_reference], [point], [display_name], [item_type])
VALUES (@PK,geography::Point(@Latitude, @Longitude, 4326),@DisplayName, @ItemType)
END